import Vue from 'vue'
import VueRouter from 'vue-router'
import  index from '../views/index.vue'

Vue.use(VueRouter)



const routes = [
    {
      path:'/',
      redirect:'/shopping'
    },
    {
      path:'/index',
      name:index,
      component:index
    },
    {
      path:'/shopping',
      name:'shopping',
      component:()=>import('../views/shopping.vue')
    },
    {
      path:'/service',
      name:'service',
      component:()=>import('../views/service.vue')
    },
    {
      path:'/my',
      name:'my',
      component:()=>import('../views/my.vue')
    },
    // 商品详情
    {
      path:'/shopping/details',
      name:'details',
      component:()=>import('../views/details.vue')
    },
    // 下单页面
    {
      path:'/order',
      name:'order',
      component:()=>import('../views/order.vue')
    },
    //订单提交页面
    {
      path:'/completeorder',
      name:'completeorder',
      component:()=>import('../views/completeorder.vue')
    },
    //选择支付页面
    {
      path:'/selectpayment',
      name:'selectpayment',
      component:()=>import('../views/selectpayment.vue')
    },
    //地址页面
    {
      path:'/address',
      name:'address',
      component:()=>import('../views/address.vue')
    },
    //添加新地址
    {
      path:'/newaddress',
      name:'newaddress',
      component:()=>import('../views/newaddress.vue')
    },
    //登录
    {
      path:'/login',
      name:'login',
      component:()=>import('../views/login.vue')
    },
    //我的订单
    {
      path:'/myshopping',
      name:'myshopping',
      component:()=>import('../views/myshopping.vue')
    },
    //我的收藏
    {
      path:'/mycollection',
      name:'mycollection',
      component:() =>import('../views/mycollection.vue')
    },
    //搜索页面
    {
      path:'/search',
      name:'search',
      component:()=>import('../views/search.vue')
    }
  ]
  
  const router = new VueRouter({
  routes,
  linkActiveClass: 'ok',
})

export default router